<template>
    <div>
        <div class="show-pc">
            <div>
                <div class="home_right_icon">
                    <div @click="toggleTheme">
                        <div>

                            <img v-show="themeshow" src="../../../assets/images/new_img/yueliang.png"
                                class="icfonPng" />
                            <img v-show="!themeshow" src="../../../assets/images/new_img/taiyang.png"
                                class="icfonPng" />
                        </div>
                    </div>
                    <div class="line"></div>
                    <div>
                        <div><img @click="openUploadFile" src="../../../assets/images/new_img/shangchuan.png"
                                class="icfonPng_2" /></div>
                    </div>
                </div>
            </div>
        </div>

        <div class="show-wap">
            <div @click="toggleTheme">
                <div class="icfonPng-box-wap">
                    <img v-show="themeshow" src="../../../assets/images/new_img/yueliang.png" class="icfonPng-wap" />
                    <img v-show="!themeshow" src="../../../assets/images/new_img/taiyang.png" class="icfonPng-wap" />
                </div>

            </div>
        </div>
    </div>

    <uploadFileVue ref="uploadFileRef"></uploadFileVue>

</template>

<script setup>

import { useStore } from '@/store'
import { ref } from 'vue';
const { themeStore } = useStore()
const themeshow = ref(true);
import uploadFileVue from '~/components/uploadWorks/index.vue';
const uploadFileRef = ref(null)
import { getUserId } from "@/utils/token.js"
import { message } from 'ant-design-vue'
// 接口
import { useHttp } from '@/api/http'



// 切换主题
const toggleTheme = () => {
    themeshow.value = !themeshow.value
    themeStore.changeTheme()
}


// 打开上传
const openUploadFile = () => {
    if (methods.authorization('system:pc:upload')) {
        uploadFileRef.value.open()
    } else {
        message.warning('暂无权限')

    }

    // if (!getUserId()) {
    //     message.warning('请先登录！')
    //     return
    // }
}



</script>

<style lang="less" scoped>
.home_right_icon {
    width: 4.16vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.2vw;
    color: #666;


    .line {
        width: 0px;
        height: 0.52vw;
        color: #666;
        border: 1px solid #c3c0c0;


    }

    .icfonPng {
        width: 1.2vw;
        height: 1.2vw;
        cursor: pointer;
    }

    .icfonPng_2 {
        width: 1.2vw;
        height: 1.3vw;
        cursor: pointer;
    }
}


.icfonPng-box-wap {
    .icfonPng-wap {
        width: 24px;
        height: 24px;
    }
}
</style>